<HTML><HEAD><TITLE>writeln(+Stream, ?Term)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Term I/O</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>writeln(+Stream, ?Term)</H1>
The term Term is written on the output stream Stream according to the
current operator declarations.  Equivalent to write(Stream,Term),
nl(Stream).


<DL>
<DT><EM>Stream</EM></DT>
<DD>Integer (stream number) or Atom (reserved or user-defined                symbolic stream name).
</DD>
<DT><EM>Term</EM></DT>
<DD>Prolog term.
</DD>
</DL>
<H2>Description</H2>
   Used to write the term Term (followed by a newline) on the output stream
   Stream according to the current operator declarations.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>writeln(+, ?) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Stream is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Stream is not an atom or an integer.
<DT><EM>(192) illegal stream mode </EM>
<DD>Stream is not an output stream.
<DT><EM>(193) illegal stream specification </EM>
<DD>Stream is an illegal stream specification.
</DL>
<H2>Examples</H2>
<PRE>
   Success:
      [eclipse]: open(file1,update,s), writeln(s, X + 2),
      &gt; writeln(s, Y + 3), close(s).
      X = _90
      Y = _78
      yes.
      [eclipse]: sh('cat file1').
      _90 + 2
      _78 + 3
      yes.

Error:
      writeln(S, a(b,c)).        (Error 4).
      writeln("string", a(b,c)). (Error 5).
      writeln(9, X + 2).         (Error 192).
      writeln(atom, X + 2).      (Error 193).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/ioterm/writeln-1.html">writeln / 1</A>, <A HREF="../../kernel/ioterm/write-1.html">write / 1</A>, <A HREF="../../kernel/ioterm/write-2.html">write / 2</A>
</BODY></HTML>
